package cn.emall.portal.controller;

import cn.emall.content.service.ContentService;
import cn.emall.pojo.TbContent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * 首页展示Controller
 */
@Controller
public class IndexController {

    @Value("${CATAGORY_ID_LUNBOTU}")
    private Long CATAGORY_ID_LUNBOTU;

    @Autowired
    private ContentService contentService;

    @RequestMapping("/index")
    public String showIndex(Model model){
        List<TbContent> ad1List = contentService.getContentListByCid(CATAGORY_ID_LUNBOTU);
        model.addAttribute("ad1List",ad1List);
        return "index";
    }
}
